import { COUNTER_PLUS_ONE } from "./constant";
import initialState from './initialState'

// action
export const counterPlusOne = ()=>{
  return {
    type: COUNTER_PLUS_ONE
  };
}

// reducer
export const reducer = (state = initialState, action) => {
  switch (action.type) {
    case COUNTER_PLUS_ONE:
      console.log('state in plus:',state)
      return { count: state.count + 1 }
    default:
      console.log('state in default plus:',state)
      return state
  }
}


